import 'package:flutter/material.dart';

class ImageButton extends StatelessWidget {
  final bool isImagePrefix;
  final String title;
  final String image;
  final VoidCallback? onPressed;

  const ImageButton(
      {super.key,
      required this.title,
      required this.image,
      this.onPressed,
      this.isImagePrefix = true});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return GestureDetector(
      onTap: onPressed,
      child: Row(
          children: isImagePrefix
              ? [
                  Image.asset(image),
                  Text(
                    title,
                    style: const TextStyle(
                      color: Color(0xff666666),
                      fontSize: 12,
                    ),
                  ),
                ]
              : [
                  Text(
                    title,
                    style: const TextStyle(
                      color: Color(0xff666666),
                      fontSize: 12,
                    ),
                  ),
                  Image.asset(image),
                ]),
    );
  }
}
